package com.dhc.appbusinessfrm.ioc.presenter;

import com.dhc.appbusinessfrm.ioc.AppModule;
import com.dhc.appbusinessfrm.ioc.business.BusinessModule;
import com.dhc.appbusinessfrm.ioc.cache.CacheModule;
import com.dhc.appbusinessfrm.ioc.network.NetModule;
import com.dhc.appbusinessfrm.presenter.LoginPresenter;
import com.dhc.appbusinessfrm.presenter.LoginPresenterImpl;
import com.dhc.appbusinessfrm.view.activity.LoginActivity_;
import com.dhc.appbusinessfrm.view.activity.LoginInteractor;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

@Module(
        injects = LoginActivity_.class,addsTo = AppModule.class
)
public class LoginPresenterModule {

    private LoginInteractor loginInteractor;

    public LoginPresenterModule(LoginInteractor loginInteractor) {
        this.loginInteractor = loginInteractor;
    }

    @Provides
    @Singleton
    public LoginInteractor provideLoginInteractor() {
        return this.loginInteractor;
    }

    @Provides
    @Singleton
    public LoginPresenter providePresenter(LoginInteractor loginInteractor) {
        return new LoginPresenterImpl(loginInteractor);
    }
}
